package com.farm.quartz.Dao;

import com.farm.quartz.model.haohao;
import com.farm.quartz.model.wuDepInfo;
import com.farm.quartz.model.wuLawPer;
import com.farm.quartz.model.wuWoInfo;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public interface wuWoInfoDao extends JpaRepository<wuWoInfo,Integer> {
    //根据id查询
    wuWoInfo getById(int juanid);
    //查询所有数据
    ArrayList<wuWoInfo> findAllBy();
    //根据名字查询，暂时未用




    @Modifying
    @Transactional
    @Query(value="delete from wu_wo_info  where juanid = ?", nativeQuery = true)
    Integer delete(int juanid);

    @Modifying
    @Transactional
    @Query(value="update wu_wo_info set id = ?1 ,type = ?2 ,count = ?3 ,time=?4 where juanid = ?5", nativeQuery = true)
    Integer update(int id, String type, int count, String time,int juanid);


    List<wuWoInfo> findAllBy(Pageable pageable);
    int countAllBy();








}